//
//  CarFloorPriceCell.m
//  New_Runway
//
//  Created by mack on 2018/1/25.
//  Copyright © 2018年 NelsonJ. All rights reserved.
//

#import "CarFloorPriceCell.h"

@interface CarFloorPriceCell ()
//@property (weak, nonatomic) IBOutlet UILabel *floorPrice;
@property (weak, nonatomic) IBOutlet UILabel *firstTime;
@property (weak, nonatomic) IBOutlet UILabel *outsideColor;
@property (weak, nonatomic) IBOutlet UILabel *insideColor;
@property (weak, nonatomic) IBOutlet UILabel *carType;
@property (weak, nonatomic) IBOutlet UILabel *displacementL;
@property (weak, nonatomic) IBOutlet UILabel *box;
@property (weak, nonatomic) IBOutlet UILabel *oilType;
@property (weak, nonatomic) IBOutlet UILabel *dischargeStandard;
@property (weak, nonatomic) IBOutlet UILabel *is4S;
@property (weak, nonatomic) IBOutlet UILabel *onePrice;
@property (weak, nonatomic) IBOutlet UIView *backview;
@property (weak, nonatomic) IBOutlet UILabel *strongDate;
@property (weak, nonatomic) IBOutlet UILabel *businessDate;
@property (weak, nonatomic) IBOutlet UILabel *checkDate;

@end

@implementation CarFloorPriceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backview.backgroundColor = UIColorHex(0xf1f1f1);
}
- (void)setCarInfo:(CarResult *)carInfo{
    _carInfo = carInfo;
    self.firstTime.text = carInfo.carOutColor ? carInfo.carOutColor : @"--" ;
    
    if (isEmptyOrNilString(carInfo.carInColor) == YES) {
        self.outsideColor.text = @"--";
    }else{
        self.outsideColor.text =  carInfo.carInColor;
    }
    if (isEmptyOrNilString(carInfo.carType.carTypeName) == YES) {
        self.carType.text = @"--";
    }else{
        self.carType.text =  carInfo.carType.carTypeName;
    }
    if (isEmptyOrNilString(carInfo.carDisplacement) == YES) {
        self.displacementL.text = @"--";
    }else{
        self.displacementL.text =  [NSString stringWithFormat:@"%@%@",carInfo.carDisplacement,carInfo.carInletModel];
    }
    if (isEmptyOrNilString(carInfo.carGearbox) == YES) {
        self.box.text = @"--";
    }else{
        self.box.text =  carInfo.carGearbox;
    }
    if (isEmptyOrNilString(carInfo.carFuel) == YES) {
        self.oilType.text = @"--";
    }else{
        self.oilType.text =  carInfo.carFuel;
    }
  
    if (isEmptyOrNilString(carInfo.carEnviron) == YES) {
        self.dischargeStandard.text = @"--";
    }else{
        self.dischargeStandard.text = carInfo.carEnviron;
    }
    if (carInfo.car4sUpkeepState == 0) {
        self.insideColor.text =@"不是";

    }else{
       self.insideColor.text = @"是";
    }
    
    
    if (_carInfo.carValidateDate != 0 ) {
        self.is4S.text = [NRWCarTurnTime timestampSwitchTime:_carInfo.carValidateDate andFormatter:@"YYYY-MM"];
    }else{
        self.is4S.text = @"--";
        
    }
    
    if (_carInfo.carForceInsuranceDate != 0 ) {
        self.strongDate.text = [NRWCarTurnTime timestampSwitchTime:_carInfo.carForceInsuranceDate andFormatter:@"YYYY-MM"];
    }else{
        self.strongDate.text = @"--";
        
    }
    if (_carInfo.carBusinessInsuranceDate != 0 ) {
        self.businessDate.text = [NRWCarTurnTime timestampSwitchTime:_carInfo.carBusinessInsuranceDate andFormatter:@"YYYY-MM"];
    }else{
        self.businessDate.text = @"--";
        
    }
//    if (_carInfo.carValidateDate != 0 ) {
//        self.checkDate.text = [NRWCarTurnTime timestampSwitchTime:_carInfo.carValidateDate andFormatter:@"YYYY-MM"];
//    }else{
//        self.checkDate.text = @"--";
//        
//    }
    
    
////    self.onePrice.text = @"新车指导价";
//    if (_carInfo.carFixedPriceState == 0) {
//        self.onePrice.text = @"不是一口价";
//    }else{
//        self.onePrice.text = @"一口价";
//    }

    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
